home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / graphz11.zip / GRAPHZ.H < prev    next >
Text File  |  1995-04-08  |  6KB  |  154 lines

  1. /*******************************************************************/
  2. /* GraphZ.h - header file to support the GraphZ graphical library. */
  3. /* Copyright ⌐ 1995, C. van Zwynsvoorde. All rights reserved.      */
  4. /*******************************************************************/
  5.  
  6.  
  7. #define MAXFONTNAME            41
  8.  
  9. /*******************/
  10. /* TITLE structure */
  11. /*******************/
  12. typedef struct
  13.     {
  14.     char    szTitle[81];                /* the graph's tile */
  15.     char    szFontName[MAXFONTNAME];    /* title font family name */
  16.     int        nFontSize;                  /* title font size in pts */
  17.     BOOL    bBold;                      /* bold or regular */
  18.     BOOL    bItalic;                    /* italic or regular */
  19.     BOOL    bUnderline;                 /* underline or not */
  20.     BOOL    bGraved;                    /* graved or not (display only) */
  21.     BOOL    bEmbossed;                  /* embossed or not (display only) */
  22.     BOOL    bBorder;                    /* border or not (display only) */
  23.     COLORREF color;                     /* RGB text color (ignored for sculpted styles )*/
  24.     } TITLE, NEAR *PTITLE, FAR *LPTITLE;
  25.  
  26.  
  27. /*******************/
  28. /* CURVE structure */
  29. /*******************/
  30. typedef struct
  31.     {
  32.     LOGPEN    pen;                /* logical color pen */
  33.     BYTE    nSymbol;            /* symbol (see the symbol codes definitions below) */
  34.     BOOL    bNoLine;            /* plot no line, only symbols */
  35.     BOOL    bAlarms;            /* use alarm effects ? */
  36.     double    alarmLow;           /* low alarm limit */
  37.     BYTE    nSymbolLow;         /* symbol to plot if value < low alarm limit */
  38.     double    alarmHigh;          /* high alarm limit */
  39.     BYTE    nSymbolHigh;        /* symbol to plot if value > high alarm limit */
  40.     char    szLegend[31];       /* name for this curve */
  41.     BYTE    reserved[10];       /* reserved for internal use. Do not modify ! */
  42.     } CURVE, NEAR *PCURVE, FAR *LPCURVE;
  43.  
  44.  
  45. /************************************************************/
  46. /* Symbol codes definitions for the CURVE.nSymbol attribute */
  47. /************************************************************/
  48. #define    SYM_NONE        0
  49. #define SYM_CIRCLE        1
  50. #define SYM_SQUARE        2
  51. #define SYM_PLUS        3
  52. #define SYM_CROSS        4
  53. #define SYM_DIAMOND        5
  54. #define SYM_DOT            6
  55. #define SYM_STAR        7
  56. #define SYM_TRIANGLE    8
  57.  
  58.  
  59. /*******************/
  60. /* GRAPH structure */
  61. /*******************/
  62. #define NUM_CURVES            16
  63. typedef struct
  64.     {
  65.     char    szIniFile[81];              /* the path and filename of the settings file */
  66.     TITLE    title;                      /* the graph's title */
  67.     char    szXLabel[41];               /* label for the X axis (horizontal) */
  68.     char    szYLabel[41];               /* label for the Y axis (vertical) */
  69.     double    xRate;                      /* real interval between two successive entries */
  70.     double    xStart;                     /* real x-value of the first entry */
  71.     double    xRange;                     /* real x-value range that has to be displayed */
  72.     double    yMin, yMax;                 /* y-scale boundaries when not in autoscale mode */
  73.     double    logBase;                    /* base for logarithm scaling (eg. 10 for decimal log) */
  74.     BOOL    bAutoscale;                 /* autoscale the Y axis */
  75.     BOOL    bLogarithmic;               /* logarithmic Y-scale */
  76.     BOOL    bGrid;                      /* display a grid ? */
  77.     BOOL    bTics;                      /* display tics and tic labels */
  78.     BOOL    bMouseTrack;                /* display the real under mouse point coordinates */
  79.     WORD    wTimeFormat;                /* date/time format code for the x axis (see the codes below) */
  80.     WORD    bufferLen;                  /* number of buffered values for each curve */
  81.     WORD    numCurves;                  /* number of curves */
  82.     char    szFontName[MAXFONTNAME];    /* font family name for all but the title */
  83.     int        nFontSize;                    /* font size in pts */
  84.     COLORREF background;                /* curves-box background RGB-color */
  85.     LOGPEN    penGrid;                    /* the pen to use for the grid */
  86.     LOGPEN    penTics;                    /* the pen to use for the tics */
  87.     CURVE    curves[NUM_CURVES];         /* the curves definition */
  88.     BYTE    reserved[500];
  89.     } GRAPH, NEAR *PGRAPH, FAR *LPGRAPH;
  90.  
  91.  
  92.  
  93. /********************************************************/
  94. /* date/time codes for the GRAPH.wTimeFormat attribute. */
  95. /* Combine with the bitwise or operator (|).            */
  96. /********************************************************/
  97. #define DATE_NO            0x0000
  98. #define DATE_DMY        0x0001
  99. #define DATE_YMD        0x0002
  100. #define DATE_MDY        0x0003
  101. #define DATE_DmY        0x0004
  102. #define DATE_YmD        0x0005
  103. #define DATE_mDY        0x0006
  104.  
  105. #define TIME_NO            0x0000
  106. #define TIME_HM            0x0100
  107. #define TIME_MS            0x0200
  108. #define TIME_HMS        0x0300
  109. #define TIME_S99        0x0400
  110. #define TIME_MS99        0x0500
  111. #define TIME_HMS99        0x0600
  112.  
  113.  
  114.  
  115. /***********************/
  116. /* Function prototypes */
  117. /***********************/
  118. BOOL FAR PASCAL GZRegister(LPSTR szName, LPSTR szCode);
  119. BOOL FAR PASCAL GZGetSettings(HWND hWnd, LPGRAPH lpGraph);
  120. BOOL FAR PASCAL GZSetSettings(HWND hWnd, LPGRAPH lpGraph);
  121. BOOL FAR PASCAL GZAddPoints(HWND hWnd, double FAR *lpValues, WORD nNumValues);
  122. void FAR PASCAL GZLoadIni(HWND hWnd);
  123. void FAR PASCAL GZWriteIni(HWND hWnd);
  124. BOOL FAR PASCAL GZSetIni(HWND hWnd, LPSTR lpszIniFile);
  125. void FAR PASCAL GZExtractDate(double datetime, LPINT lpnDay, LPINT lpnMonth, LPINT lpnYear);
  126. void FAR PASCAL GZExtractTime(double datetime, LPINT lpnHour, LPINT lpnMinute, LPINT lpnSecond, LPINT lpnHundredth);
  127. double FAR PASCAL GZMakeDate(BYTE nDay, BYTE nMonth, WORD nYear,
  128.                 BYTE nHour, BYTE nMinute, BYTE nSecond, BYTE nHundredth);
  129.  
  130.  
  131. /*
  132.  *
  133.  *
  134.  * Include the following in your project's .DEF file:
  135.  *
  136.  * IMPORTS
  137.  *            GZRegister=GraphZ.1
  138.  *            GZAddPoints=GraphZ.2
  139.  *            GZGetSettings=GraphZ.3
  140.  *            GZSetSettings=GraphZ.4
  141.  *            GZWriteIni=GraphZ.5
  142.  *            GZLoadIni=GraphZ.6
  143.  *            GZSetIni=GraphZ.7
  144.  *            GZMakeDate=GraphZ.8
  145.  *            GZExtractTime=GraphZ.9
  146.  *            GZExtractDate=GraphZ.10
  147.  *
  148.  * And make a case insensitive link and import.
  149.  *
  150.  *
  151.  *
  152.  */
  153.  
  154.